package controllers.interfaces.tenant;

import java.util.Map;

import controllers.BaseController;
import net.sf.json.JSONObject;
import producers.ISIPAccount;
import producers.SIPAccount;
import utils.Constant;

public class SipAccounts extends BaseController{

    public static void create(){
        String sid = Constant.UCPAAS_SID;
        String token = Constant.UCPAAS_TOKEN;
        String appId = params.get("appId");
        appId = Constant.UCPAAS_APPID; //测试使用
        ISIPAccount sipAccount = new SIPAccount(sid,token,appId);
        Map<String,String> result = sipAccount.create(sid, token, appId, null);
        renderJSON(JSONObject.fromObject(result));
    }
    
    public static void destroy(){
        String sid = Constant.UCPAAS_SID;
        String token = Constant.UCPAAS_TOKEN;
        String appId = params.get("appId"); 
        appId = Constant.UCPAAS_APPID; //测试使用
        String clientNumber = params.get("clientNumber");
        ISIPAccount sipAccount = new SIPAccount(sid,token,appId);
        Map<String,String> result = sipAccount.destroy(sid, token, appId, clientNumber);
        renderJSON(JSONObject.fromObject(result));
    }
    
}
